<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <cpn></cpn>
        <cpn>
            <!-- 目的是:为了获取子组件中的pLanguages -->
            <template slot-scope='slot'>
                <span>{{slot.data.join('-')}}</span>
            </template>
        </cpn>
        <cpn>
            <template slot-scope='slot'>
                <ol>
                    <li v-for='item in slot.data'>{{item}}</li>
                </ol>
            </template>
        </cpn>
    </div>

    <template id="cpn">
        <div>
            <slot :data='pLanguages'>
                <ul>
                    <li v-for='item in pLanguages'>{{item}}</li>
                </ul>
            </slot>
        </div>
    </template>
    <script src= '../js/vue.js'></script>
    <script>
        const cpn = {
            template: '#cpn',
            data() {
                return {
                    pLanguages:['JavaScript', 'Python', 'Java', 'C#', 'Spring']
                }
            }
        }
        const app = new Vue({
            el:'#app',
            data:{

            },
            components:{
                cpn
            },
            methods:{
                
            }
        })
    </script>
</body>
</html>